<?php

/**
 * This is the model class for table "jumlahkeluarga".
 *
 * The followings are the available columns in table 'jumlahkeluarga':
 * @property integer $jkl_id
 * @property integer $jkl_kec
 * @property integer $jkl_praks
 * @property integer $jkl_ks1
 * @property integer $jkl_ks2
 * @property integer $jkl_ks3
 * @property integer $jkl_ks3plus
 * @property integer $jkl_jumlah
 * @property integer $jkl_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $jklKec
 */
class Jumlahkeluarga extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahkeluarga the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahkeluarga';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jkl_kec, jkl_praks, jkl_ks1, jkl_ks2, jkl_ks3, jkl_ks3plus, jkl_jumlah, jkl_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jkl_id, jkl_kec, jkl_praks, jkl_ks1, jkl_ks2, jkl_ks3, jkl_ks3plus, jkl_jumlah, jkl_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'jklKec' => array(self::BELONGS_TO, 'Kecamatan', 'jkl_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jkl_id' => 'Jkl',
			'jkl_kec' => 'Jkl Kec',
			'jkl_praks' => 'Jkl Praks',
			'jkl_ks1' => 'Jkl Ks1',
			'jkl_ks2' => 'Jkl Ks2',
			'jkl_ks3' => 'Jkl Ks3',
			'jkl_ks3plus' => 'Jkl Ks3plus',
			'jkl_jumlah' => 'Jkl Jumlah',
			'jkl_tahun' => 'Jkl Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jkl_id',$this->jkl_id);
		$criteria->compare('jkl_kec',$this->jkl_kec);
		$criteria->compare('jkl_praks',$this->jkl_praks);
		$criteria->compare('jkl_ks1',$this->jkl_ks1);
		$criteria->compare('jkl_ks2',$this->jkl_ks2);
		$criteria->compare('jkl_ks3',$this->jkl_ks3);
		$criteria->compare('jkl_ks3plus',$this->jkl_ks3plus);
		$criteria->compare('jkl_jumlah',$this->jkl_jumlah);
		$criteria->compare('jkl_tahun',$this->jkl_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}